#ifndef __FSMC_H__
#define __FSMC_H__	
#include "sys.h"
#include "main.h"
#include "stdlib.h" 

#define LCD_REGION_NUMBER		MPU_REGION_NUMBER0		//LCD使用region0
#define LCD_ADDRESS_START		(0X6C000000)			//LCD区的首地址
#define LCD_REGION_SIZE			MPU_REGION_SIZE_256MB   //LCD区大小

#define FSMC_RAM    *(__IO uint16_t *) (0x6C000002)    	//地址寄存器
#define FSMC_REG    *(__IO uint16_t *) (0x6C000000)	 	//指令寄存器

void write_cmd(unsigned short cmd);
void Write_DATA(unsigned short data_code );
void MCU_2832_write_CMD(u8 channel,u16 cmd);
void MCU_2832_write_CMD_NOCS(u16 cmd);
void MCU_2832_Write_Data(u8 channel,u16 data_code );
u16 MCU_2832_Read_Data(u8 channel);

void FSMC_Pure_Pic(u16 PIC_NUM);
void FSMC_Edit_Logic_Pic(u16 PIC_NUM,u32 Color_M,u32 Color_L,u16 X0,u16 X1,u16 Y0,u16 Y1,u16 R0);
void FSMC_Pure_colour(u32 Color);
void FSMC_BMP_NUM(u8 BMP_NUM);
void FSMC_OLED_Parameter(u32* buf,u8 SigMode);
void FSMC_Open(u16 Init_Mode);
void FSMC_IO_init(void);
#endif
